-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Conversation
@@ -194,12 +197,14 @@ - (void)monitorLocationChanges:(NSArray *)arguments { | |||
_locationManager.pausesLocationUpdatesAutomatically = arguments[1]; | |||
if (@available(iOS 11.0, *)) { | |||
_locationManager.showsBackgroundLocationIndicator = arguments[2]; | |||
[self setShowsBackgroundLocationIndicator:_locationManager.showsBackgroundLocationIndicator]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bkonyi - is it safe to move this up here? It seemed like it, but wanted to make sure there weren't expectations of setting any other state before calling this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this should be fine. It's just saving the state to reset the location manager object, so ordering shouldn't really matter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with a nit and a question 😄
@@ -8,7 +8,7 @@ | |||
|
|||
@implementation LocationBackgroundPlugin { | |||
CLLocationManager *_locationManager; | |||
FlutterHeadlessDartRunner *_headlessRunner; | |||
FlutterEngine *_headlessRunner; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: should we rename the variable as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could, I didn't have strong opinions on it. It is still meant to be headless, never getting a Viewcontroller attached to it at present AFAIK
@@ -48,7 +48,9 @@ - (BOOL)application:(UIApplication *)application | |||
_locationManager.showsBackgroundLocationIndicator = | |||
[self getShowsBackgroundLocationIndicator]; | |||
} | |||
_locationManager.allowsBackgroundLocationUpdates = YES; | |||
if (@available(iOS 9.0, *)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bkonyi What should we do when this is not supported? throw an error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error or warning?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When this isn't supported that parameter is ignored (pretty sure it's mentioned in the Dart docs).
* Update location_background
This reverts commit a243508.
FlutterHeadlessDartRunner is now deprecated and effectively a typedef for FlutterEngine.
One method got renamed. This PR also adds some guards around API calls that need it.
This will have to be landed on red to fix the build.